package mapper.xml;



import com.xl98.entity.Permission;
import com.xl98.entity.Role;
import com.xl98.service.PermissionService;
import com.xl98.service.RoleService;
import com.xl98.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;
import java.util.List;

@SpringBootTest
class Xl98ApplicationTests {
       @Autowired
        private RoleService roleService;
        @Autowired
        private PermissionService permissionService;
        @Autowired
       private UserService userService;

    @Test
    void contextLoads1(){
            List<Role> roles = roleService.selectRoleByUserId("02017241131");
            for (Role role : roles) {
                    System.out.println(role.getName());
            }
        List<Permission> permissions = permissionService.selectPermByRole(roles);
        for (Permission permission : permissions) {
            System.out.println(permission.getName());
        }
    }
}
